Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add calculation to display correct pull request velocity #47

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

k1nho
Copy link
Contributor

@k1nho k1nho commented Sep 28, 2023

Description

This PR adds a calculation to get the correct pull request velocity percentage to display. It calculates the percentage with the same formula implemented by thegetPercent(total, count) method. This approach is used in dev-card component via getPercent(prTotal, mergedPrs) to render the percentage in the VelocityPill.

https://github.com/open-sauced/app/blob/5b15a49d6dfbd371799d7dbf81cd5cbfef5e1d60/lib/utils/get-percent.ts#L1

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Fixes #45

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 docs.opensauced.pizza
  • 🍕 dev.to/opensauced
  • 📕 storybook
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

bug

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Compliance Checks Passed!

Copy link
Member

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!! 👏🏼 I think this needs just abit more to be in line with what we surface in the insights app. For example, on Nick's profile:

Screenshot 2023-10-02 at 2 10 49 PM

and in the pizza show:

Screenshot 2023-10-02 at 2 11 35 PM

So, the 80 in this case should really be "80% merged" which represents the percent of merged prs within the given time frame. And we should also surface 1d which represents that averge velocity of prs to merge. You should be able to pull off the

m.userInfo.RecentPullRequestVelocityCount

which gets surfaced off the API.

So something like this (ignore the poorly formatted table 🙈 )?

  │                  nickytonline                  │
  │                                                │
  │ 🔥 PR Velocity (30d): 1d - 80% merged    📄 Issues: 50    │
  │                                                │
  │                                                │
  │ 🚀 PR Count (30d): 17      🔨 Maintainer: true │
  │                                                │

@k1nho k1nho force-pushed the fix/calculate-pr-velocity-count branch from c23b330 to 5a17c5d Compare October 3, 2023 16:26
@k1nho
Copy link
Contributor Author

k1nho commented Oct 3, 2023

Thanks for the feedback! I understand better this metric. I always though it referred to the percentage, but reading through this issue was helpful refactor: update pr velocity indicator

Copy link
Member

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕺🏼

@jpmcb jpmcb requested a review from a team October 3, 2023 17:08
Copy link
Contributor

@brandonroberts brandonroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📈

@jpmcb jpmcb merged commit 156992b into open-sauced:beta Oct 4, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: pr velocity inaccurate in pizza show
3 participants